<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>修改密码</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<link rel="stylesheet" type="text/css" href="css/reset.css">
	<style type="text/css">
		body{
			background: #fff;
		}
		#form{
			text-align: center;
			padding-top: 1rem;
		}
		#form>input{
			height:.6rem;
			width:75%;
			margin:.2rem auto 0;
			border-bottom: 2.3px solid #D0D0D0;
			font-size: .3rem;
			color: #C0C0C0;
		}
	</style>
</head>
<body>
	<div id="layout">
		<form id="form">
			<input id="pasd1" type="password" name="pw" value="" placeholder="请输入新密码" maxlength="6" minlength="6">
			<input id="pasd2" type="password" name="rpw" value="" placeholder="请再次输入" maxlength="6" minlength="6">
			<input id="id" type="hidden" name="id">
		</form>
		<p id="notice" class="hide"></p>
		<p id="submit" class="gma-btn" style="margin-top:1rem">确认修改</p>
	</div>
</body>
<script type="text/javascript" src="plugins/jquery.min.js"></script>
<script type="text/javascript" src="plugins/touch.min.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/baseInfoForm.js"></script>
<script type="text/javascript">
var sendData={};
var globalHost=common.globalHost;
var resetPWPort=common.resetPWPort;
var url=globalHost+resetPWPort;
var $form=$('#form');
var $pasd1=$('#pasd1');
var $pasd2=$('#pasd2');
var $notice=$('#notice');
var $submit=$('#submit');
var $id=$('#id');
var id=common.getLocalData('H5-agentInfo').id;
$submit.off('tap').on('tap',function(e){
	var val3=$id.val(id);
	var val1=$pasd1.val();
	var val2=$pasd2.val();
	var reg=/^[0-9]{6}$/;
	var regResult =reg.test(val1);
	if(val1!=''&&val1===val2&&!!regResult){
		var sendData=common.getSendDataByForm($form);
		//console.log(sendData)
		baseInfoForm.formPost({
			url:url,
			sendData:sendData,
			resSuccess:function(data){
				window.location.href="changePasswordEnd.html";
			}
		})
	}else if(val1==''||val2==''){
		baseInfoForm.changeMsg('请输入新密码');
	}else{
		baseInfoForm.changeMsg('您输入的密码不一致');
	}
	e.preventDefault();
	return false;
})
</script>
</html>